
#ifndef _APDU_LIB_FILE_MGR_H_
#define _APDU_LIB_FILE_MGR_H_

#include "../apdu.def/apdu_datatypes.h"


#ifdef __cplusplus
extern "C" {
#endif

	int app_create_file(HANDLE devHandle, int app_id, unsigned char * file_attrs, int attrs_size);

	int app_delete_file(HANDLE devHandle, int app_id, char * file_name);

	int app_enum_files(HANDLE devHandle, int app_id, char * file_names, int * buff_size);

	int app_get_file_info( HANDLE devHandle, int app_id, char * file_name,
					unsigned int * file_size, unsigned int * read_rights, unsigned int * write_rights );
	
	int app_set_file_info(HANDLE devHandle, int app_id,  char * file_name, 
					unsigned char * file_attrs, int attrs_size);

	int app_read_file(HANDLE devHandle, int app_id, char * file_name, 
					int offset, int *read_len, unsigned char* pData);
	
	int app_write_file( HANDLE devHandle, int app_id, char * file_name, 
					int offset, unsigned char * write_data, int write_len );

	int app_crypt_read_file(HANDLE devHandle, int app_id, int container_id, int key_id, char * file_name, 
							int offset, int *read_len, unsigned char* pData, int is_final);

	int app_crypt_write_file( HANDLE devHandle, int app_id, int container_id, int key_id, char * file_name, 
							int offset, unsigned char * write_data, int write_len, int is_final);


	int app_set_current_file_pos(HANDLE devHandle, int pos);

	
	

#ifdef __cplusplus
}
#endif

#endif
